package com.liaoyifan.core.model;

import com.liaoyifan.core.converter.ConverterList;
import java.util.List;

@SuppressWarnings("unused")
public interface CoreConverter<S, T> {

    T convert(S source);

    S reverse(T target);

    default List<T> convert(List<S> list) {
        return ConverterList.of(list, this::convert);
    }

    default List<S> reverse(List<T> list) {
        return ConverterList.of(list, this::reverse);
    }
}
